package com.hz.lowb.nami.base.dao;

import com.hz.lowb.nami.base.dto.User;
import org.apache.ibatis.annotations.*;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;

/**
 * Created by tfw2302 on 2017/1/11.
 */
@Mapper
@CacheConfig(cacheNames = "users")
public interface UserDao {

    @Cacheable()
    User getByName(@Param("name") String name);

//    @Select("SELECT user_name FROM nami_user WHERE user_id = #{id}")
//    String getNameById(@Param("id") Long id);

//    @CachePut(key = "#p0.userMobile")
//    @Select("UPDATE nami_user SET user_mobile = #{userMobile} WHERE user_name = #{userName}")
//    void updateUser(User Use);
//
//    @Cacheable()
//    @Insert("INSERT INTO nami_user(user_name, user_password) VALUES(#{name}, #{password})")
//    int insert(@Param("name") String name, @Param("password") String password);

}
